<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<style type="text/css">
	#table{margin-top:50px}
</style>

<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
	$(function(){
		$("#testJson").click(function(){
			var tableVal = "";
			$("#table").html("");
			var url = this.href;
			var args = {};
			$.get(url,function(data){
				for(var i = 0; data.length > i; i++){
					tableVal += "<tr>";
					tableVal += "<td>" + data[i].id + "</td>";
					tableVal += "<td>" + data[i].lastName + "</td>";
					tableVal += "<td>" + data[i].email + "</td>";
					tableVal += "<td>" + data[i].department.departmentName + "</td>";
					tableVal += "</tr>";
// 					$("<tr></tr>").append("<td>" + data[i].id + "</td>")
// 								  .append("<td>" + data[i].lastName + "</td>")
// 								  .append("<td>" + data[i].email + "</td>")
// 								  .append("<td>" + data[i].department.departmentName + "</td>")
// 								  .appendTo($("#table"));
				}
				$("#table").append(tableVal);
			});
			return false;
		});
	})
</script>


</head>
<body>
	
	<form action="${pageContext.request.contextPath }/springmvc/testFileupload" method="post" enctype="multipart/form-data">
		File:<input type="file" name="file">
		FileDesc:<input type="text" name="fileDesc">
		<input type="submit">
	</form>


	<a href="employee/emps">Employee List</a>
	<br><br>
	<a href="employee/emp">Employee Input</a>
	<br><br>
	<a href="springmvc/testJson" id="testJson">TestJson</a>

	<table id="table" cellpadding="10" border="2">
	</table>

	<form action="springmvc/testHttpMessageConverter" method="post" enctype="multipart/form-data">
		File:<input type="file" name="file">
		FileDesc:<input type="text" name="fileDesc">
		<input type="submit">
	</form>
	<br>
	<a href="springmvc/testResponseEntity">testResponseEntity</a>
	<br>
	<a href="${pageContext.request.contextPath }/i18n1">To i18n</a>
	<br>
	<a href="${pageContext.request.contextPath }/springmvc/testI18n">testI18n</a>
	<br>
	<a href="${pageContext.request.contextPath }/springmvc/testExceptionHandlerException">testExceptionHandlerException</a>
	<br>
	<a href="${pageContext.request.contextPath }/springmvc/testResponseStatus">testResponseStatus</a>
	<br>
	<a href="${pageContext.request.contextPath }/springmvc/testSimpleMappingException?i=1">testSimpleMappingException</a>
</body>
</html>